CC=gcc
CFLAGS=-Wall -Werror -Wextra -Os -fPIE
LD=ld
LDFLAGS=-melf_x86_64 -r --whole-archive
LPATH=-L.
ZIGFLAGS=-Drelease-small --strip -target x86_64-linux-musl
# -Drelease-fast
# --single-threaded
# -march=native
# "x86_64-linux-gnu",
# "x86_64-linux-gnux32",
# "x86_64-linux-musl",
# x86_64-windows x86_64-macosx aarch64v8-linux



.PHONY: clean hello leak cimport zag queue curltest

%.o: %.c
	$(CC) -o $@ -c $(CFLAGS) $^

hello:
	zig build-exe hello.zig $(ZIGFLAGS) 
leak:
	zig build-exe $(ZIGFLAGS) leak.zig 
cimport:
	zig build-exe $(ZIGFLAGS) cimport.zig -lc -lraylib
zag:
	zig build-exe $(ZIGFLAGS) zag.zig
queue:
	zig test queue.zig
curltest:
	zig build-exe zig-curl-test.zig --library curl --library c $(pkg-config --cflags libcurl)
clean:
	rm -f *.o *.a hello leak cimport zag zig-curl-test